const Router = require('koa-router')
const banner = new Router()
const query = require('../../utils/db')

banner.get('/', async ctx => {
  ctx.body = 'list根路径'
})

banner.get('/list', async ctx => {
  let res = '123'
  let sql = `select * from banner`
  res = await new Promise((resolve, reject) => {
    return query(sql, (err, data) => {
      resolve(data)
    })
  })

  ctx.body = res
})

module.exports = banner
